import { chain } from '@/utils/common';
import { loginMiddleware, loginMatcher  } from './middlewares/login';
import { limitMiddleware, limitMatcher  } from './middlewares/limit';
import { redirectMiddleware, redirectMatcher  } from './middlewares/redirect';

const middlewares = [loginMiddleware, limitMiddleware, redirectMiddleware];
const matcher = ["/((?!.*\\..*|_next).*)", "/", "/(api|trpc)(.*)"];

export default chain(middlewares);

export const config = {
  matcher:["/((?!.*\\..*|_next).*)", "/", "/(api|trpc)(.*)"]
}
